package 课堂;

/**
 * Created By  醉美柳舞之众星捧月
 *
 * @author song
 * @date 2017/11/10 15:08
 */
public class 递归一1加到100等于5050 {
    public static void main(String[] args) {
        System.out.println(m(100));
    }

    static int num = 0;
    static int sum = 0;

    public static int m(int max) {
        if (num <= max) {
            sum += num;
            num++;
            m(max);
        }
        return sum;
    }
}
